package onetomany;

import org.hibernate.Session;
import org.junit.Test;

import enity5.News;
import utils.H3Utils;

public class Main3 {
	
	@Test
	public void newsProcess() {
		Session session = H3Utils.getCurrentSession();
		session.beginTransaction();
		News news = new News();
		news.setTitle("习近平同塞尔维亚总统武契奇通电话");
		news.setContent("新华社北京4月14日电 国家主席习近平14日晚同塞尔维亚总统武契奇通电话。");
		session.save(news);
		session.getTransaction().commit();
		session.close();
	}
	
	
	public static void main(String[] args) {
		Session session = H3Utils.getCurrentSession();
		session.beginTransaction();
		
		session.getTransaction().commit();
		session.close();
	}
}
